Learning Objectives

After completing this lesson, you'll be able to:

In this lesson, you will:

Resources

MCPCaller

The MCPCaller transformer connects to an existing MCP server to work with MCP tools, resources, and prompts. The MCPCaller is the key component that enables FME to act as an MCP client, calling MCP tools on a server and receiving the output. 

Within your FME workspace, the MCPCaller connects to an MCP server and issues a request. If the MCP server requires authentication, the MCPCaller uses a web connection to authorize access to the server. Each MCP server has a unique URL that you enter into the MCPCaller to connect to it. Using the URL, the MCPCaller connects and requests the MCP server when it runs. If the MCP server requires authentication, you may need to enable Override Server and enter the MCP server URL to override the URL saved in the web connection. Every MCP server URL must support streamable HTTP transport. 

The MCPCaller can perform various types of requests to the MCP server, from inquiries to executions. There are options to list and interact with tools, resources, and prompts. Instead of building a custom connector for each external service, FME can connect to an MCP server, inspect the tools it exposes, and call them consistently. The result can then be parsed, transformed, written, routed, or combined with other data using standard FME transformers.

Depending on the MCP request method, the MCPCaller will require additional data to input along with the request to the MCP server. For example, the call tool method requires you to select the tool and provide additional input as JSON.  

The output from the MCPCaller will vary by method, although all communication between the MCP server and client uses JSON as the protocol standard. To return the raw JSON of the MCP response for that operation, enable the Include JSON Response option in the Advanced section. This may be useful for inspecting the full server response or accessing fields not otherwise exposed as attributes. 

Note

The MCPCaller is an optional input transformer, meaning that an input record is not required to run it. When input records are provided to the MCPCaller, it runs once per record received to the Input port. If no input is connected to the transformer, it will run only once. For more information on optional input transformers, see Transformers with an Optional Input Port

List Tools

The List Tools request returns a list of all available MCP tools from the server. It is a discovery inquiry about the MCP server you are working with and is the best place to start when working with MCP. By running a List Tools request, you confirm that the MCPCaller can successfully connect to the server, and it returns the currently available tool names, descriptions, and schemas.

List Tools does not require any additional input beyond setting the MCP server to query; however, the Advanced options allow you to control whether each tool is returned as an individual record or combined into a single list. 

The output from the MCPCaller List Tools includes the tool name, title, description, and JSON schemas for input and output. The List Tools results allow you or an AI model to analyze which tool best performs the task you need and which inputs you require to run the tool. 

Call Tool

The Call Tool method requests the MCP server to run the specified tool. If the MCPCaller has multiple inputs, it will make multiple Call Tool requests, one for each input record. If no input is provided to the MCPCaller, it will make the Call Tool request only once and output a single record. 

Once you select the tool to call, the MCPCaller parameters update to show you the input JSON schema the tool expects, along with a Tool Input section to configure. The JSON input to a tool may come from an Attribute or Text, or from a File containing the input JSON. To customize the tool input from your data, reference attribute values in the JSON Text. 

The output from a Call Tool request creates a _data attribute containing the tool call's results in JSON. You can further parse the JSON into attributes with the JSONFragmenter to continue working with the MCP output in your workspace. 

Exercise

To start working with MCP and FME, Frank is going to connect to an existing weather MCP server using the MCPCaller in FME Workbench. He's going to use the MCPCaller to discover what tools his MCP server provides, and also call a tool to return some weather data and information. Eventually, Frank can integrate this workspace alongside his future utility data MCP server to provide real-time weather metrics with some of the utility data workflows. 

In this exercise, you will:

1) Open FME Workbench

2) Add an MCPCaller to List Tools

Frank already has an external MCP server running and ready to connect to. It provides tools for weather information based on an input location, such as weather forecasting and air quality metrics. You will configure the MCPCaller to connect to this server. 

FME connects to the MCP server, discovers its available tools, and returns a feature for each available tool.

3) Call a Tool

{
	"current_weather": true,
	"forecast_days": 7,
	"latitude": 49.2827,
	"longitude": -123.1207,
	"precipitation_unit": "mm",
	"temperature_unit": "celsius",
	"timezone": "America/Vancouver",
	"wind_speed_unit": "kmh"
}

So far, you've successfully connected to the weather MCP server, viewed its available tools, and successfully called a tool. Now, instead of calling a single tool with an MCPCaller, or needing multiple MCPCallers to call different MCP tools, you will use an AIConnector to select which tool to call based on user input dynamically.